<?php
header ("Content-Type:text/html; charset= utf-8");
require_once ('config.php');
require_once (WEBURL.'/include/conn.php');
require_once (WEBURL.'/login_status_check.php');

if(empty($_POST['article_id'])){
	echo "forbidden!";
	exit();
}
$article_id=$_POST['article_id'];
$article_title=$_POST['article_title'];
if(!checkLogin()){
	$gotopage=base64_encode("article_remove.php?article_id=$article_id&article_title=$article_title");
	header("Location:admin_login.php?gotopage=".$gotopage);

}
else{
	require_once (WEBURL.'/channel.class.php');
	//require_once (XunSearchPath.'/sdk/php/lib/XS.php');
	$sql_remove_article="delete from article_normal where article_id=$article_id;";
	//echo $sql_remove_article;
	$result_remove_article=mysql_query($sql_remove_article) or die(mysql_error());
	if($result_remove_article){
		/*清除专题信息*/
		$sql_remove_special_topic_infor="delete from special_topic_article where article_id=$article_id";
		mysql_query($sql_remove_special_topic_infor) or die(mysql_error());
		/*删除搜索表信息*/
		$sql_remove="delete from search where id=$article_id";
		mysql_query($sql_remove) or die(mysql_error());

		/*删除索引信息
		$xs = new XS('sys');
		$index = $xs->index;
		$index->del($article_id);
		*/
		echo "<script language=JavaScript> alert('删除文章成功！');history.go(-2);</script>";
	}
}

